Skip to content

feat: Resolve best seat across orgs for rate limits#1884

Open
charlesvien wants to merge 3 commits intomainfrom
04-24-resolve_best_seat_across_orgs_for_rate_limits
Open

feat: Resolve best seat across orgs for rate limits#1884
charlesvien wants to merge 3 commits intomainfrom
04-24-resolve_best_seat_across_orgs_for_rate_limits

Conversation

@charlesvien
Copy link
Copy Markdown
Member

@charlesvien charlesvien commented Apr 24, 2026

Problem

Users with a pro plan in one org were getting free-tier rate limits in other orgs because the gateway resolved plans per (user_id, team_id) instead of the user's best plan across all orgs.

Changes

  1. Pass best=true to getMySeat so the API returns the highest-tier seat across all orgs
  2. Add organization_id and organization_name to SeatData type
  3. Track billingOrgId in seat store to switch org context before opening billing
  4. Switch to the billing org via switchOrganization before opening the billing page
  5. Use server-provided redirectUrl for billing errors instead of hardcoding

How did you test this?

Manually

Copy link
Copy Markdown
Member Author

charlesvien commented Apr 24, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@charlesvien charlesvien changed the base branch from 04-20-wizard_integration_and_first_data-less_tasks to graphite-base/1884 April 24, 2026 23:17
@charlesvien charlesvien force-pushed the 04-24-resolve_best_seat_across_orgs_for_rate_limits branch from 65a972f to 5512777 Compare April 24, 2026 23:17
@charlesvien charlesvien changed the base branch from graphite-base/1884 to main April 24, 2026 23:17
@charlesvien charlesvien changed the title Resolve best seat across orgs for rate limits feat: Resolve best seat across orgs for rate limits Apr 24, 2026
@charlesvien charlesvien marked this pull request as ready for review April 24, 2026 23:18
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/shared/types/seat.ts
Line: 20

Comment:
**Unused field added to type**

`organization_name` is added to `SeatData` but is never read in any of the changed files (only `organization_id` is consumed). This violates the simplicity principle of having no superfluous parts. If it's needed for a future feature, it should be added in that PR.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Resolve best seat across orgs for rate l..." | Re-trigger Greptile

Comment thread apps/code/src/shared/types/seat.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant